<?php

namespace app\admin\model;

use think\Model;
use app\common\model\Type as TypeModel;

class AdminConfig extends Model {

    public function getConf() {
        $configGroup = TypeModel::where('pid', 3)->where('display', 1)->order('pid asc,list_order asc')->column('name', 'describe');
        $siteList = [];

        $list = $this->all();
        foreach ($list as $v) {
            if (!isset($configGroup[$v['group']])) {
                continue;
            }
            $siteList[$v['group']][$v['name']] = $v['value'];
        }

        return $siteList;
    }

}
